package tourist.springboot.utils;

import tourist.springboot.bean.ResponseData;

/**
 * Created by wangzhiguo on 2019/6/28 0028.
 */
public class ResponseDataUtils {

    public static ResponseData successResponse(){
        return ResponseData.builder().code(Constants.SUCCESS_CODE)
                .message(Constants.SUCCESS_MSG).build();
    }
    public static ResponseData successResponse(Object data){
        return ResponseData.builder().code(Constants.SUCCESS_CODE)
                .data(data)
                .message(Constants.SUCCESS_MSG).build();
    }

    public static ResponseData errorResponse(){
        return ResponseData.builder().code(Constants.ERROR_CODE)
                .message(Constants.ERROR_MSG).build();
    }
    public static ResponseData errorResponse(String message){
        return ResponseData.builder().code(Constants.ERROR_CODE)
                .message(message).build();
    }
}
